import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
//        Files files = new Files("D:\\项目\\25安徽某证券公司代码审计","D:\\项目\\25安徽某证券公司代码审计\\dirs.txt",".docx");
//        Files files = new Files(args[0],args[1],args[2]);
//        Set<String> jspSet = SiteJsps.getJsps();
//        System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++++" + jspSet.size());
//        for (String jsp : jspSet) {
//            System.out.println(jsp);
//        }
        getCha();

//        String pa = "C:\\Users\\Administrator\\Desktop\\apache-tomcat-8.0.24\\webapps\\ROOT\\JSONService\\config.jsp";
//        System.out.println(pa.substring(pa.indexOf("ROOT") + 4,pa.length()));
    }

    /**
     * 取差集
     */
    public static void getCha() {
        Set<String> jspSet = SiteJsps.getJsps();
        String filesStr = SiteJsps.readFileByLines("D:\\项目\\25安徽某证券公司代码审计\\RootJspFile.txt");
        String[] files = filesStr.split(",");

        for (int i = 0; i < files.length; i++) {
            String file = files[i].substring(files[i].indexOf("ROOT") + 4,files[i].length());
            if (!jspSet.contains(file)) {
                System.out.println(file);
            }
        }
    }


}
